package com.mmdccj.yugu.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * @Author: star_
 * @date: 2023-11-22 21:57
 */
@Mapper
public interface SocialInfoMapper {
    // 根据用户id获取关注数
    @Select("select count(*) from follow where follower_id = #{id}")
    int getNumberOfConcernsById(String id);

    // 根据用户id获取粉丝数
    @Select("select count(*) from follow where followed_id = #{id}")
    int getNumberOfFansById(String id);

    // 根据用户id获取动态数
    @Select("select count(*) from user_comment where user_id = #{id} AND type= 'p'")
    int getNumberOfPost(String id);
}
